package com.oa.xinxi.biz;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.oa.xinxi.dao.WorkZJMapper;
import com.oa.xinxi.entity.WorkZJ;
@Service
public class WorkZJBiz {
	@Resource
	private WorkZJMapper workZJMapper;
	public void save(WorkZJ workZJ) {
		workZJ.setCreatetime(new Date());
		workZJMapper.insert(workZJ);
	}
	public void deleteById(int id) {
		workZJMapper.deleteByPrimaryKey(id);
	}
	public void update(WorkZJ workZJ) {
		workZJ.setUpdatetime(new Date());
		WorkZJ workZJ2 = workZJMapper.selectByPrimaryKey(workZJ.getWorkZjId());
		workZJ.setCreatetime(workZJ2.getCreatetime());
		workZJ.setCreator(workZJ2.getCreator());
		workZJMapper.updateByPrimaryKeySelective(workZJ);
	}
	public WorkZJ findById(Integer id) {
		return workZJMapper.selectByPrimaryKey(id);
	}
	public List<WorkZJ> findAll() {
		return workZJMapper.findAll();
	}
}
